package com.chinasoft04.mall.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class Result {
    Object data;
    Meta meta;

    public static Result success(String msg){
        Meta meta = new Meta();
        meta.setStatus(200);
        meta.setMsg(msg);
        Result result = new Result();
        result.setMeta(meta);
        return result;
    }
    public static Result success(Object data, String msg){
        Meta meta = new Meta();
        meta.setStatus(200);
        meta.setMsg(msg);
        Result result = new Result();
        result.setMeta(meta);
        result.setData(data);
        return result;
    }
}
